from django.contrib import admin
from .models import Guest, Hotel, Room, Booking

admin.site.site_header = 'Fast-booking酒店预约系统'  # 后台显示
admin.site.site_title = 'Fast-booking酒店预约系统'  # 网站名称
admin.site.index_title = '欢迎使用Fast-booking酒店预约管理系统'


class GuestAdmin(admin.ModelAdmin):
    list_display = ('name', 'age', 'phone')


admin.site.register(Guest, GuestAdmin)


class HotelAdmin(admin.ModelAdmin):
    list_display = ('name', 'city', 'phone')


admin.site.register(Hotel, HotelAdmin)


class RoomAdmin(admin.ModelAdmin):
    list_display = ('room_no', 'hotel', 'room_type', 'rate', 'is_available')
    ordering = ['room_no']


admin.site.register(Room, RoomAdmin)


class BookingAdmin(admin.ModelAdmin):
    list_display = ('guest', 'room', 'hotel', 'no_of_guests', 'checkin_date',
                    'checkout_date', 'check_out', 'charge')


admin.site.register(Booking, BookingAdmin)
